app.controller("headerController", function($scope, $location, UserService)
{
	UserService.UserInfo().success(function(data, status, headers, config)
	{
		if (data.id != null) {
			$scope.HasUser = true;
			$scope.UserName = data.name;
		}
		else
		{
			$scope.HasUser = false;
			var indexUrl = $location.protocol() + ":\\\\" + $location.host() + ":" + $location.port() + "/index.html";
			window.location.replace( indexUrl );
		}
	}).error(function(data, status, headers, config) {
		$scope.HasUser = false;
		var indexUrl = $location.protocol() + ":\\\\" + $location.host() + ":" + $location.port() + "/index.html";
		window.location.replace( indexUrl );
	});
});